package winningPlayerCount

func winningPlayerCount(n int, pick [][]int) int {
	res := 0
	counts := make([][]int, n)
	for i := 0; i < n; i += 1 {
		counts[i] = make([]int, 12)
	}
	for _, tmp := range pick {
		x, y := tmp[0], tmp[1]
		if counts[x][11] == 1 {
			continue
		}
		counts[x][y] += 1
		if counts[x][y] > x {
			counts[x][11] = 1
			res += 1
		}
	}
	return res
}
